package com.xiaoli.computertest;
import java.util.ArrayList;
import java.util.HashMap;

import android.app.ListActivity;
import android.os.Bundle;
import android.widget.SimpleAdapter;

import com.xiaoli.computertest.R;


public class EditListActivity extends ListActivity {
    

	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.list);
        ArrayList<HashMap<String,String>> list =new ArrayList<HashMap <String ,String >>();
        HashMap<String ,String > map1=new HashMap<String, String>();
        HashMap<String ,String > map2=new HashMap<String, String>();
        HashMap<String ,String > map3=new HashMap<String, String>();
        map1.put("CommonName","Adder's-Tongue");
		map1.put("Light", "Mostly Shady");
		map1.put("Price", "6.59");
		map1.put("Available", "02/01/2006");
		map2.put("CommonName","Anemone");
		map2.put("Light", "Mostly Shady");
		map2.put("Price", "8.86");
		map2.put("Available", "04/27/2006");
		map3.put("CommonName","Bee Balm");
		map3.put("Light", "Shade");
		map3.put("Price", "4.59");
		map3.put("Available", "05/03/2006");

		list.add(map1);
		list.add(map2);
		list.add(map3);
		SimpleAdapter listAdapter=new SimpleAdapter (this,list ,R.layout.item,new String[]{"CommonName","Light","Price","Available"},new int[]{R.id.CommonName,R.id.Light,R.id.Price,R.id.Available});

        setListAdapter(listAdapter);
    }
}
